package com.mycrawler.tbcrawler.action;

import java.util.List;

import org.apache.commons.lang3.StringUtils;

import com.mycrawler.pojo.TLink;
import com.mycrawler.taobao.TaobaoLuceneSearch;

public class RelativeWordAction extends BaseAction {

	private List<TLink> links;

	private TLink param = new TLink();

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public String queryRelativeWords() throws Exception {
		if (StringUtils.isEmpty(param.getAnchor())) {
			return SUCCESS;
		}
		logger.info("查询关键词：[" + param.getAnchor() + "]");

		links = new TaobaoLuceneSearch().get(param.getAnchor());

		return SUCCESS;
	}

	public List<TLink> getLinks() {
		return links;
	}

	public void setLinks(List<TLink> links) {
		this.links = links;
	}

	public TLink getParam() {
		return param;
	}

	public void setParam(TLink param) {
		this.param = param;
	}

}
